package com.example.spingioc.component;

import com.example.spingioc.model.UserInfo;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class UserComponent {

//    private UserInfo userInfo;
//
//    @Autowired
//    @Qualifier("userInfo4")
//    private UserInfo ui;

    @Resource(name = "userInfo2")
    private UserInfo ui;

    public void say(){
        System.out.println("UserComponent say...");
        System.out.println(ui);
    }
}
